﻿using System;
using System.Configuration;

namespace Framework.Config
{
    /// <summary>
    /// Represents the singleton implementation of the Apworks configuration reader.
    /// </summary>
    public sealed class FrameworkConfigurationReader
    {
        #region Private Static Fields
        private static readonly FrameworkConfigurationReader instance = new FrameworkConfigurationReader();
        #endregion

        #region Ctor
        static FrameworkConfigurationReader() { }
        /// <summary>
        /// Initializes a new instance of <c>ApworksConfigReader</c> class.
        /// </summary>
        private FrameworkConfigurationReader()
        {
            this.Config = (FrameworkConfigurationSection)ConfigurationManager.GetSection(Constants.Configuration.ConfigurationSectionName);
        }
        #endregion
        #region Public Static Properties
        /// <summary>
        /// Gets the singleton instance of the <c>ApworksConfigReader</c> class.
        /// </summary>
        public static FrameworkConfigurationReader Instance { get { return instance; } }
        #endregion

        #region Public Properties
        /// <summary>
        /// Gets the instance of the Apworks configuration section.
        /// </summary>
        public FrameworkConfigurationSection Config { get; private set; }
 
        /// <summary>
        /// Gets the type name of the default sequence generator.
        /// </summary>
        #endregion
    }
}
